//
//  DCCarMessageBaseCell.m
//  Driver
//
//  Created by 大橙子 on 2018/11/8.
//  Copyright © 2018 Tomous. All rights reserved.
//

#import "DCCarMessageBaseCell.h"

@implementation DCCarMessageBaseCell
-(void)setUpBaseUIView
{
    self.firstView = [[UIView alloc]init];
    self.firstView.backgroundColor = [UIColor whiteColor];
    [self addSubview:self.firstView];
    
    self.plateNumLabel = [[UILabel alloc]init];
    self.plateNumLabel.text = @"京A88888";
//    self.plateNumLabel.backgroundColor = [UIColor redColor];
    [self.firstView addSubview:self.plateNumLabel];
    self.stateLabel = [[UILabel alloc]init];
    self.stateLabel.textColor = [UIColor redColor];
    self.stateLabel.text = @"满载";
    self.stateLabel.textAlignment = NSTextAlignmentRight;
//    self.stateLabel.backgroundColor = [UIColor yellowColor];
    [self.firstView addSubview:self.stateLabel];
    
    self.secondView = [[UIView alloc]init];
    self.secondView.backgroundColor = [UIColor whiteColor];
    [self addSubview:self.secondView];
    
    self.carImageView = [[UIImageView alloc]init];
//    self.carImageView.backgroundColor = [UIColor cyanColor];
    self.carImageView.image = IMAGENAME(@"1234567");
    [self.secondView addSubview:self.carImageView];
    self.nameLabel = [[DCImageAndTextLabel alloc]init];
    self.nameLabel.imageView.image = IMAGENAME(@"司机");
    self.nameLabel.textLabel.text = @"司机";
    self.nameLabel.textLabel.textColor = [UIColor lightGrayColor];
//    self.nameLabel.backgroundColor = [UIColor greenColor];
    [self.secondView addSubview:self.nameLabel];
    self.phoneLabel = [[DCImageAndTextLabel alloc]init];
    self.phoneLabel.imageView.image = IMAGENAME(@"phone line circle");
    self.phoneLabel.textLabel.text = @"电话";
    self.phoneLabel.textLabel.textColor = [UIColor lightGrayColor];
//    self.phoneLabel.backgroundColor = [UIColor redColor];
    [self.secondView addSubview:self.phoneLabel];
    self.locationLabel = [[DCImageAndTextLabel alloc]init];
    self.locationLabel.imageView.image = IMAGENAME(@"Icon Location");
    self.locationLabel.textLabel.text = @"定位";
    self.locationLabel.textLabel.textColor = [UIColor lightGrayColor];
//    self.locationLabel.backgroundColor = [UIColor yellowColor];
    [self.secondView addSubview:self.locationLabel];
    
    self.thirdView = [[UIView alloc]init];
    self.thirdView.backgroundColor = [UIColor whiteColor];
    [self addSubview:self.thirdView];
    
    self.protectBtn = [UIButton buttonWithType:UIButtonTypeCustom];
//    self.protectBtn.backgroundColor = BlueColor;
    [self.protectBtn setTitle:@"保养维护" forState:UIControlStateNormal];
    self.protectBtn.titleLabel.font = FONT(16);
    self.protectBtn.layer.cornerRadius = 14;
    self.protectBtn.clipsToBounds = YES;
    self.protectBtn.layer.borderColor = BlueColor.CGColor;
    self.protectBtn.layer.borderWidth = 1;
    [self.protectBtn setTitleColor:BlueColor forState:UIControlStateNormal];
    self.protectBtn.tag =0;
    [self.thirdView addSubview:self.protectBtn];
    
    self.driveMsgBtn = [UIButton buttonWithType:UIButtonTypeCustom];
//    self.driveMsgBtn.backgroundColor = BlueColor;
    [self.driveMsgBtn setTitle:@"驾驶数据" forState:UIControlStateNormal];
    self.driveMsgBtn.titleLabel.font = FONT(16);
    self.driveMsgBtn.layer.cornerRadius = 14;
    self.driveMsgBtn.clipsToBounds = YES;
    self.driveMsgBtn.layer.borderColor = BlueColor.CGColor;
    self.driveMsgBtn.layer.borderWidth = 1;
    [self.driveMsgBtn setTitleColor:BlueColor forState:UIControlStateNormal];
    self.driveMsgBtn.tag =1;
    [self.thirdView addSubview:self.driveMsgBtn];
}
-(void)setUpLayoutSubViews
{
    self.firstView.frame = CGRectMake(0, 5, self.width, kBaseSubViewHeight);
    self.plateNumLabel.frame = CGRectMake(10, 0, self.firstView.width/2, kBaseSubViewHeight);
    __weak typeof(self) weakself = self;
    [self.stateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(weakself.firstView);
        make.right.equalTo(weakself.firstView.mas_right).offset(-10);
        make.height.mas_offset(kBaseSubViewHeight);
        make.width.mas_offset(weakself.firstView.width/2);
    }];

}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
